package com.puzzlebazar.client.puzzle.model;

import com.puzzlebazar.client.util.Observable;

public interface MoveTimer extends Observable {

	/**
	 * Access the current value of the timer in textual form
	 * 
	 * @return The timer in textual form
	 */
	String getText();
	
	/**
	 * Access the current value of the timer in milliseconds
	 * 
	 * @return The timer in milliseconds
	 */
	long peekTime();

	/**
	 * @return True if the timer is currently running, false if not
	 */
	boolean isRunning();

	/**
	 * Starts the timer
	 * Call notifyObservers()
	 */
	void start();

	/**
	 * Stops the timer
	 * Call notifyObservers()
	 */
	void stop();

	/**
	 * Performs a single step of the timer
	 * Call notifyObservers()
	 */
	void step();
	
	/**
	 * Sets the current time of the timer
	 * Call notifyObservers()
	 *
	 * @param currentTime the time to use for the timer right now
	 */
	void set( long currentTime );

	/**
	 * Sets the speed of this move timer
	 * Call notifyObservers()
	 *
	 * @param speed The desired speed for this timer
	 */
	void setSpeed( long speed );

	/**
	 * Access the speed of this timer
	 * 
	 * @return The speed of this timer
	 */
	long getSpeed();

}
